package com.oak.designmode._07_proxyParttern.staticProxy;

/**
 * 静态代理
 * @Description
 * @Author guoxy
 * @Date 2019/11/30
 * @Version 1.0
 */
public class Test {

    public static void main(String[] args){

        //创建被代理类
        BuyCar buyCarImpl = new BuyCarImpl();
        buyCarImpl.buyCar();
        System.out.println("----------------------------------");

        //创建BuyCar的代理类
        BuyCar buyCarProxy = new BuyCarProxy(buyCarImpl);
        //代理类执行buyCar方法
        buyCarProxy.buyCar();
    }
}
